define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'user.level/index',
        add_url: 'user.level/add',
        edit_url: 'user.level/edit',
        delete_url: 'user.level/delete',
        export_url: 'user.level/export',
        modify_url: 'user.level/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'ID'},
                    {field: 'level_show', title: '等级'},
                    {field: 'invite', title: '邀请人数'},
                    {field: 'buy_num', title: '产生购买'},
                    {field: 'brokerage_sum', title: '个人佣金累计'},
                    {field: 'node_bug_ratio', title: '矿机购买返佣比例多层级返佣","隔开'},
                    {field: 'node_hosting_ratio', title: '矿机托管返佣比例多层级返佣","隔开'},
                    {field: 'node_power_ratio', title: '云算力产出返佣比例多层级返佣","隔开'},
                    {field: 'entrust_plots_ratio', title: '委托P盘返佣比例多层级返佣","隔开'},
                    {field: 'deposit_coin_ratio', title: '存币生息返佣比例多层级返佣","隔开'},
                    {field: 'loan_ratio', title: '借贷返佣比例多层级返佣","隔开'},
                    {field: 'create_time', title: '创建时间'},
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});